x86emul: defer rIP-relative address calculation
authorJan Beulich <jbeulich@suse.com>
Fri, 9 Dec 2016 11:04:49 +0000 (12:04 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 9 Dec 2016 11:04:49 +0000 (12:04 +0100)
commitb286dd2604e736d66bce37291e1ffcb5ce57397d
tree1245a1626445bb4c0662c52b9dc9917389496458
parentd445f0cc38412ce55959b3da68b9fb481b6d9d45
x86emul: defer rIP-relative address calculation

By putting it after all instruction fetching has been done, we can both
simplify the existing handling of immediate operands and take care of
any future instructions allowing rIP-relative operands and getting
additional bytes fetched in x86_decode_*() (the current cases of extra
bytes getting fetched there are only for operands without ModR/M bytes,
or with them only allowing their register forms).

Similarly the new placement of truncate_ea() will take care of any
future cases of non-standard memory operands (the one existing case -
opcodes A0...A3 - are fine with and without this, as they fetch an
ad_bytes sized unsigned address anyway).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/x86_emulate.c